<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="icon" href="static/img/logo.png" type="image/png">
    <link rel="stylesheet" href="static/css/auth.css">
    <title>用户注册 - 智慧答题系统</title>
</head>
<body>
    <div class="auth-container">
        <div class="auth-card">
            <div class="auth-header">
                <div class="logo">
                    <img src="static/img/logo.png" alt="Logo">
                    <h2>智慧答题</h2>
                </div>
                <h1>创建账号</h1>
                <p>加入我们，开启智慧之旅</p>
            </div>

            <form class="auth-form" id="registerForm">
                <!-- 成功提示 -->
                <div class="success-message" id="successMessage" style="display: none;"></div>
                
                <!-- 错误提示 -->
                <div class="error-banner" id="errorBanner" style="display: none;">
                    <span class="error-icon">⚠️</span>
                    <span id="errorText"></span>
                </div>
                
                <div class="form-group">
                    <label for="regUsername">用户名</label>
                    <input type="text" id="regUsername" name="username" required placeholder="请输入用户名（3-20字符）">
                    <span class="error-message" id="regUsernameError"></span>
                </div>

                <div class="form-group">
                    <label for="regEmail">邮箱</label>
                    <input type="email" id="regEmail" name="email" required placeholder="请输入邮箱地址">
                    <span class="error-message" id="regEmailError"></span>
                </div>

                <div class="form-group">
                    <label for="regPassword">密码</label>
                    <input type="password" id="regPassword" name="password" required placeholder="请输入密码（至少6位）">
                    <span class="error-message" id="regPasswordError"></span>
                    <div class="password-strength">
                        <div class="strength-bar" id="strengthBar">
                            <div class="strength-fill"></div>
                        </div>
                        <span class="strength-text" id="strengthText">密码强度</span>
                    </div>
                </div>

                <div class="form-group">
                    <label for="regConfirmPassword">确认密码</label>
                    <input type="password" id="regConfirmPassword" name="confirmPassword" required placeholder="请再次输入密码">
                    <span class="error-message" id="regConfirmPasswordError"></span>
                </div>

                <div class="form-options">
                    <label class="checkbox-label">
                        <input type="checkbox" id="agreeTerms" required>
                        <span>我已阅读并同意<a href="#">《用户协议》</a>和<a href="#">《隐私政策》</a></span>
                    </label>
                    <span class="error-message" id="termsError"></span>
                </div>

                <button type="submit" class="btn-primary" id="registerBtn">
                    <span>注册</span>
                    <span class="btn-loading" style="display:none;">注册中...</span>
                </button>

                <div class="auth-footer">
                    <p>已有账号？<a href="/login">立即登录</a></p>
                    <p><a href="/">返回首页</a></p>
                </div>
            </form>

            <div class="social-login">
                <div class="divider">
                    <span>或者</span>
                </div>
                <div class="social-buttons">
                    <button class="social-btn wechat">
                        <span class="social-icon">💬</span>
                        <span>微信注册</span>
                    </button>
                    <button class="social-btn qq">
                        <span class="social-icon">🐧</span>
                        <span>QQ注册</span>
                    </button>
                </div>
            </div>
        </div>
    </div>

    <script src="static/js/auth.js"></script>
</body>
</html>

